package top.resty.erp.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.resty.erp.commont.VOBrandAndVariety;
import top.resty.erp.dao.IVariety;
import top.resty.erp.domain.Variety;
import top.resty.erp.service.VarietyService;

import java.util.List;

/**
 * <pre>
 *
 * </pre>
 *
 * @author : resty
 * @date : 2021年03月22 12:32
 */
@Service
public class VarietyServiceImpl implements VarietyService {
	
	@Autowired
	private IVariety iVariety;
	
	@Override
	public boolean saveVariety(Variety variety) {
		return iVariety.saveVariety(variety)==1?true:false;
	}
	
	@Override
	public List<VOBrandAndVariety> getBrandAndVarieties(Integer brandId) {
		return iVariety.getBrandAndVarieties(brandId);
	}
	
	@Override
	public boolean deleteVariety(Integer id) {
		return iVariety.deleteVariety(id)==1?true:false;
	}
	
	@Override
	public boolean updateVariety(Variety variety) {
		return iVariety.updateVariety(variety)==1?true:false;
	}
	
	@Override
	public List<Variety> getVarietyForBrandId(Integer brandId) {
		return iVariety.getVarietyForBrandId(brandId);
	}
	
	@Override
	public int queryBrandIdCountsForVarieties(Integer brandId) {
		return iVariety.queryBrandIdCountsForVarieties(brandId);
	}
}
